import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
	{
		path: '/',
		redirect: '/earthHome',
	},
	{
		path: '/earthHome',
		name: 'earthHome',
		component: () => import('@/views/home/baseEarth/index'),
	},
];

const router = new VueRouter({
	routes,
});

// 路由拦截器
// router.beforeEach((to, from, next) => {
//     if (to.path === '/login') {
//         next();
//     } else {
//         let token = localStorage.getItem('token');
//         if (!token) {
//             next('/login');
//         } else {
//             next();
//         }
//     }
// });

export default router;
